package com.ruihu.admin.common.async;

import com.ruihu.admin.module.business.log.LogService;
import com.ruihu.admin.module.business.log.useroperatelog.domain.UserOperateLogEntity;
import com.ruihu.admin.third.ApplicationContext;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class AsyncFactory {

    /**
     * 记录用户日志
     * @param userOperateLogEntity
     */
    public static Runnable recordLogTask(final UserOperateLogEntity userOperateLogEntity) {
        return () -> {
            LogService logService = ApplicationContext.getBean(LogService.class);
            logService.addLog(userOperateLogEntity);
        };
    }
}
